home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / utility / utilmisc / bk_noide.lha / NoIDE.ASM < prev    next >
Assembly Source File  |  1997-01-01  |  2KB  |  81 lines

  1. ; FILE: Source:modules/NoIDE.ASM          REV: 1 --- NoIDE patch (better: hack)
  2.  
  3. ;
  4. ; NoIDE -Module
  5. ; ~~~~~~~~~~~~~~~~~~~~~
  6. ; This patch module disables the scsi.device (irritating name: it manages the IDE-interface)
  7. ; If you don't have an IDE-HD, the boot process takes up to 30 secs longer than with one
  8. ; as the scsi.device tries to find a HD on every startup...
  9. ; NOTE: You can't access any IDE-devices with this patch installed! (Ach was...) ;)
  10. ;
  11. ; Written by Christian Sauer.
  12. ; This source code is Public Domain.
  13. ;
  14.  
  15.     include "blizkickmodule.i"      ; Some required...
  16.  
  17.  
  18.     SECTION PATCH,CODE
  19. _DUMMY_LABEL
  20.     BK_PTC
  21.  
  22. ; Code is run with following incoming parameters:
  23. ;
  24. ; a0=ptr to ROM start (buffer)  eg. $1DE087B8
  25. ; a1=ptr to ROM start (ROM)     eg. $00F80000 (do *not* access!)
  26. ; d0=ROM lenght in bytes        eg. $00080000
  27. ; a2=ptr to _FindResident routine (will search ROM buffer for resident tag):
  28. ;    CALL: jsr (a2)
  29. ;      IN: a0=ptr to ROM, d0=rom len, a1=ptr to resident name
  30. ;     OUT: d0=ptr to resident (buf) or NULL
  31. ; a3=ptr to _InstallModule routine (can be used to plant a "module"):
  32. ;    CALL: jsr (a3)
  33. ;      IN: a0=ptr to ROM, d0=rom len, a1=ptr to module, d6=dosbase
  34. ;     OUT: d0=success
  35. ; a4=ptr to _Printf routine (will dump some silly things (errormsg?) to stdout ;-)
  36. ;    CALL: jsr (a4)
  37. ;      IN: a0=FmtString, a1=Array (may be 0), d6=dosbase
  38. ;     OUT: -
  39. ; d6=dosbase, a6=execbase
  40. ;
  41. ; Code should return:
  42. ;
  43. ; d0=true if succeeded, false if failed.
  44. ; d1-d7/a0-a6 can be trashed. a7 *must* be preserved! ;-)
  45.  
  46.     moveq   #0,d7
  47.  
  48.     cmp.w   #37,($C,a0)                  ; Requires KS V37+
  49.     blo.b   .exit
  50.  
  51.     lea     (_atname,pc),a1              ; _FindResident
  52.     jsr     (a2)
  53.     tst.l   d0
  54.     beq.b   .exit
  55.     move.l  d0,a2                        ; a2=scsi resident
  56.  
  57.     cmp.b   #37,(RT_VERSION,a2)          ; V37+
  58.     blo.b   .exit
  59.     bclr    #RTB_COLDSTART,(RT_FLAGS,a2) ; clear Coldstart-Flag
  60.     moveq   #1,d7
  61.  
  62. .exit   move.l  d7,d0                        ; Valid counter?
  63.     bne.b   .xit
  64.     lea     (_error,pc),a0               ; a0=fmt
  65.     pea     (_atname,pc)
  66.     move.l  sp,a1                        ; a1=array
  67.     jsr     (a4)                         ; Call _Printf
  68.     addq.l  #4,sp
  69. .fail   moveq   #0,d0                        ; Return fail
  70. .xit    rts
  71.  
  72.  
  73. _atname dc.b    'scsi.device',0
  74.  
  75. _error  dc.b    'NoIDE: This patch requires %s V37+!',10,0
  76.  
  77.  
  78.     SECTION VERSION,DATA
  79.  
  80.     dc.b    '$VER: NoIDE_PATCH 1.0 (1.1.97)',0
  81.